package com.jqkb.adapters;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.jqkb.R;

import java.util.List;

/**
 * Created by alimjantursun on 18/5/29.
 */
public class SelectTargetAdapter extends RecyclerView.Adapter {
    private final List list;
    private final Context context;

    public SelectTargetAdapter(Context context, List list) {
        this.list = list;
        this.context = context;

    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

        View view = LayoutInflater.from(context).inflate(R.layout.select_target_list_item, parent, false);
        return new ClassHolder(view);
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {


        if (holder instanceof ClassHolder) {
            ((ClassHolder) holder).nameTv.setText("努尔苏坦");
            ((ClassHolder) holder).zhiweiTv.setText("软件开发");
        }



    }

    public class ClassHolder extends RecyclerView.ViewHolder {


        TextView nameTv;
        TextView zhiweiTv;

        public ClassHolder(View itemView) {
            super(itemView);
            nameTv = (TextView) itemView.findViewById(R.id.name_tv);
            zhiweiTv = (TextView) itemView.findViewById(R.id.zhiweiTv);

        }
    }

    @Override
    public int getItemCount() {
        return 20;
    }
}
